This repository was archived by the owner on Aug 28, 2026. It is now read-only.
Apply API key middleware to /v2/check and /v2/authorize - #75
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
Conversation
The edge agent served /v2/check and /v2/authorize behind only logging middleware, so any actor with network access to the agent could query the cached authorization graph without credentials. ServerConfig.ApiKey was populated but never enforced on inbound requests. Add authMiddleware that validates the Authorization header against the configured API key (constant-time compare), matching the cloud API's "Authorization: ApiKey <key>" scheme, and reject unauthenticated requests with 401 before the handler runs. Fail closed when no key is configured. /health stays unauthenticated for readiness probes. Add HTTP-level regression tests covering unauthenticated, wrong-key, and valid-key requests.
Contributor
Author
Original prompt from Linear User
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR adds API-key authentication to the edge agent's data-plane endpoints. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "Require API key auth on /v2/check and /v..." | Re-trigger Greptile |
devin-ai-integration
Bot
deleted the
feature/sec-1235-fga-edge-agent-serves-the-environments-entire-authorization
branch
July 27, 2026 16:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The data-plane routes
/v2/checkand/v2/authorizewere served with onlyloggingMiddleware. This change applies the existing API key middleware (ServerConfig.ApiKey) to these routes so they require a configured key, consistent with other endpoints.Please review before merging.